<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/style.css">
    <link rel="icon" type="image/png" href="/static/icon.png">
    <script src="/static/jquery.js"></script>
    <title>Document</title>
    <script>
        function postFun(){
            $.ajax({
                url:"/postData",
                method:"post",
                data:{
                    name:$("#name").val()
                },
                type:"json",
                success:function(data){
                    console.log(data);
                }
            })
        }
        function getFun(){
            $.ajax({
                url:"/getData",
                method:"get",
                data:{
                    name:$("#name").val()
                },
                type:"json",
                success:function(data){
                    console.log(data);
                }
            })
        }
    </script>
</head>

<body>
    <table>
        <thead>
            <tr>
                <td>ID</td>
                <td>NAME</td>
                <td>AGE</td>
            </tr>
        </thead>
        <tbody>
            {{each users u i}}
            <tr>
                <td>{{i+1}}</td>
                <td>{{u.name}}</td>
                <td>{{u.age}}</td>
            </tr>
            {{/each}}
        </tbody>
    </table>
    <hr>
    <input type="text" id="name">
    <input type="button" value="post" onclick="postFun()">
    <input type="button" value="get" onclick="getFun()">
</body>

</html>